<template>
  <div>
      <el-descriptions>
      <el-descriptions-item label="订单编号">{{subscribeDetail.id}}</el-descriptions-item>
      <el-descriptions-item label="预约名称">{{subscribeDetail.name}}</el-descriptions-item>
      <el-descriptions-item label="预约类型">{{subscribeDetail.typeName}}</el-descriptions-item>
      <el-descriptions-item label="订单费用">
          <el-tag size="small">{{subscribeDetail.money}}</el-tag>
      </el-descriptions-item>
      <el-descriptions-item label="预约者">{{subscribeDetail.user}}</el-descriptions-item>
      <el-descriptions-item label="订单创建者">{{subscribeDetail.approver}}</el-descriptions-item>
      <el-descriptions-item label="服务开始时间">{{subscribeDetail.subscribeStartTime}}</el-descriptions-item>
      <el-descriptions-item label="服务结束时间">{{subscribeDetail.subscribeEndTime}}</el-descriptions-item>
      <el-descriptions-item label="联系电话">{{subscribeDetail.phone}}</el-descriptions-item>
      <el-descriptions-item label="备注">{{subscribeDetail.remarks}}</el-descriptions-item>
  </el-descriptions>
  
</div>
  
</template>



<script>
import { detailApi } from '@/api/modules/subscribe/order'
import { format_tableData_null,format_dateTime,format_date } from '@/utils/formatter'
export default {
  props: {
  id: {
    type: [Number, String],
    required: true
  }
},
  data() {
    return {
      subscribeDetail: {
          id: '',
          money: '',
          remarks: '',
          name: '',
          descInfo: '',
          subscribeStartTime: '',
          subscribeEndTime: '',
          typeName: '',
          phone: '',
          approver: '',
          user: ''

      }
    }
  },
  methods: {
      format_dateTime,
      format_date,
      async getDetail () {
    try {
      // const params = { id: this.id } 
      const res = await detailApi(this.id)
      this.subscribeDetail = res.data
    } catch (err) {
      console.error(err)
    }
  }
  },
  mounted () {
      this.getDetail()
  }
}
</script>